package com.ziJing.multithreading.proxy.test.proxy.jdk;

import java.lang.reflect.Proxy;

/**
 * @author zhangbo
 * @program: Multithreading
 * @ClassName JdkProxyFactory
 * @description: $
 * @date 2022-10-08 01:37:25
 */
public class JdkProxyFactory {
    public static Object getProxy(Object target){
        return Proxy.newProxyInstance(
                target.getClass().getClassLoader(), //类加载器
                target.getClass().getInterfaces(),  //代理需要实现的接口，可指定多个
                new DebugInvocationHandler(target));
    }
}
